package com.zs.blog.model.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.time.LocalDateTime;

/**
 * @Title: RoleAuthority
 * @Author zs
 * @Package com.zs.blog.model.entity
 * @Date 2025/9/8 21:34
 * @description: 角色-权限实体类
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@TableName("role_authority_rel")
public class RoleAuthority {
    @Schema(description = "主键ID")
    @TableId(type = IdType.AUTO)
    private Long id;

    @Schema(description = "角色ID")
    private Long roleId;

    @Schema(description = "系统资源权限ID")
    private Long authorityId;

    @Schema(description = "创建时间")
    @JsonFormat(locale = "zh", timezone = "GMT+8", pattern = "yyyy-MM-dd hh-mm-ss", shape = JsonFormat.Shape.STRING)
    @TableField(fill = FieldFill.INSERT)
    public LocalDateTime createTime;

    @Schema(description = "更新时间")
    @JsonFormat(locale = "zh", timezone = "GMT+8", pattern = "yyyy-MM-dd hh-mm-ss", shape = JsonFormat.Shape.STRING)
    @TableField(fill = FieldFill.INSERT_UPDATE)
    public LocalDateTime updateTime;
}
